<?php

namespace App\Http\Controllers\Community\Follower;

use App\Http\Controllers\Controller;
use App\Models\User;
use FollowerUpdate;
use Auth;
class FollowersController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    public function store(User $user)
    {
        $this->authorize('follow', $user);
        FollowerUpdate::store($user);
        return redirect()->route('users.show', $user);
    }
    public function destroy(User $user)
    {
        $this->authorize('follow', $user);
        FollowerUpdate::destroy($user);
        return redirect()->route('users.show', $user);
    }
}
